import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect:'/login',
  },
  {
    path: '/login',
    name:'login',
    component:()=>import('../views/Login.vue'),
  },
  {
    path: '/register',
    name:'register',
    component:()=>import('../views/Register.vue'),
  },
  {
    path: '/home',
    name:'home',
    component: () => import('../views/Home.vue'),
    meta: { title: '主页显示' }
  },
  {
    path: '/voiceRecognition',
    name:'voiceRecognition',
    component:()=>import('../views/VoiceRecognition.vue'),
    meta: { title: '语音识别' }
  },
  {
    path:'/userManagement',
    name:'userManagement',
    component:()=>import('../views/UserManagement.vue'),
    meta: { title: '用户管理' }
  },
  {
    path:'/voiceManagement',
    name:'voiceManagement',
    component:()=>import('../views/VoiceManagement.vue'),
    meta: { title: '语音管理' }
  },
  {
    path: '/password',
    name:'password',
    component: () => import('../views/Password.vue'),
    meta: { title: '修改密码' }
  },
  {
    path: '/person',
    name:'person',
    component: () => import('../views/Person.vue'),
    meta: { title: '个人信息' }
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
})

export default router
